package com.legendshop.openportal.sdk.model.request;

import com.legendshop.openportal.sdk.annotation.JsonValid;
import com.legendshop.openportal.sdk.model.BaseRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

import static com.legendshop.openportal.sdk.model.constants.ApiPathConstants.QUERY_PROD_PRICE;

/**
 * @Description: 商品价格查询
 * @Author lwj
 * @data 2024/7/1
 **/

@Data
@Accessors(chain = true)
public class ProdPriceRequest extends BaseRequest {

    private static final long serialVersionUID = 8187695740776417325L;


    @NotBlank(message = "sku价格查询对象不能为空")
    @ApiModelProperty(value = "sku价格查询对象，请把参数转为json字符串")
    @JsonValid(target = ProdPriceRequest.SkuInfo.class, isArrayJson = true, message = "skuList不是jsonArr类型字段， 格式如下：[{\"prodId\": \"1249844\",\"skuId\": \"802504\"}]",arrayMaxSize = 100)
    private String skuInfos;



    @Data
    public static class SkuInfo implements Serializable {
        private static final long serialVersionUID = -8498370741983699232L;

        @NotNull(message = "产品Id不能为空")
        @ApiModelProperty(value = "产品Id")
        private Long prodId;
        @NotNull(message = "sku编码不能为空")
        @ApiModelProperty(value = "sku编码")
        private Long skuId;
    }



    @Override
    @ApiModelProperty(hidden = true)
    public String getApiPath() {
        return QUERY_PROD_PRICE;

    }
}
